package com.wdb.modules.system.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.wdb.modules.security.service.dto.AuthorityDto;
import com.wdb.modules.system.domain.Role;
import com.wdb.modules.system.domain.User;
import com.wdb.modules.system.domain.vo.RoleQueryCriteria;
import com.wdb.utils.PageResult;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.List;

/**
 * @author: wendaobai@qq.com
 * @date: 2024/1/18 0018 16:01
 */
public interface RoleService extends IService<Role> {
  List<AuthorityDto> mapToGrantedAuthorities(User user);

  List<Role> findByUsersId(Long id);

  PageResult<Role> queryAll(RoleQueryCriteria criteria, Page<Object> page);

  void create(Role role);

  /**
   * 校验关联用户
   *
   * @param ids
   */
  void verification(List<Integer> ids);

  void delete(List<Integer> ids);

  List<Role> queryAll(RoleQueryCriteria criteria);

  void download(List<Role> roleList, HttpServletResponse response) throws IOException;

  void easyDownload(List<Role> roleList, HttpServletResponse response)
      throws UnsupportedEncodingException, Exception;
}
